package com.itheima.web.controller;

import com.itheima.domain.Banner;
import com.itheima.domain.Movies;
import com.itheima.service.BannerService;
import com.itheima.service.MoviesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private BannerService bannerService;

    //查询首页轮播图
    @GetMapping("/findBannerList")
    public List<Banner> findBannerList(){
        List<Banner> bannerList = bannerService.findBannerList();
        return bannerList;
    }

    @Autowired
    private MoviesService moviesService;

    //查询首页影视列表数据
    @GetMapping("/findMoviesMap")
    public Map<String,List<Movies>> findMoviesMap(){
        Map<String,List<Movies>> map =  moviesService.findMoviesMap();
        return map;
    }

}
